package com.qifan.alb2b.action.back;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qifan.alb2b.service.cache.AppCache;

@Controller
@RequestMapping("/admin/cache")
public class AppCacheController {
	private AppCache appCache;

	public void setAppCache(AppCache appCache) {
		this.appCache = appCache;
	}
	
	@RequestMapping("/refresh.adm")
	@ResponseBody
	public Map<String, Object> refreshCache(){
		appCache.destory();//先释放缓存
		appCache.initCache();//在重新初始化缓存
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("success", true);
		return map;
	}
}
